<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
  function pa(){
      return new Promise((resolve,rejected)=>{
        setTimeout(()=>{
            resolve('pa')
        },2000)
      })
  }
  function pb(){
      return new Promise((resolve,rejected)=>{
        // resolve('pb')

        rejected('pb rejected')
      })
  }
//   Promise.all(['a','b',pa(),pb(),'c']).then(result=>{
//     console.log(result)
//   },error=>{
//     console.log(error)
//   })
// Promise.resolve(100).then(value=>console.log(value))
// Promise.resolve(pa()).then(value=>console.log(value))
// pb().finally(()=>{
//     console.log('finally')
//     return pa()
// }).then(value=>{
//     console.log(value)
// },error=>{
//      console.log(error)
// })
 pb().then(value=>console.log(value)).catch( reason=>console.log(reason))
</script>